let dia = 100
let angle = 0
let noiseLevel = 0.01
let speed = 0.01
function setup() {
    wheel1 = new Wheel(windowWidth / 2 + 100, windowHeight / 2, 100)
    wheel2 = new Wheel(windowWidth / 2 - 100, windowHeight / 2, 100)

    createCanvas(windowWidth, windowHeight)
}

function draw() {
    background(220);
    // push()
    // let a = 75 * noise(frameCount * 0.01)
    // let b = floor(a)
    // translate(windowWidth / 2 + 100, windowHeight / 2 + b)
    // rotate(angle)
    // noFill()
    // circle(0, 0, dia)
    // circle(0, 0, dia * 1.1)
    // line(0, 0, dia / 2 * cos(PI / 8 * 1), dia / 2 * sin(PI / 8 * 1))
    // angle += speed
    // pop()

    wheel1.show()
    wheel2.show()
}

class Wheel {
    constructor(x, y, dia) {
        this.x = x
        this.y = y
        this.dia = dia
        this.angle = random(0, 100)
    }

    show() {
        push()
        let a = 20 * noise(frameCount * 0.01 + 10)
        let b = floor(a)
        translate(this.x, this.y + b)
        rotate(this.angle)
        noFill()
        circle(0, 0, this.dia)
        circle(0, 0, this.dia * 1.1)
        line(0, 0, this.dia / 2 * cos(PI / 8 * 1), this.dia / 2 * sin(PI / 8 * 1))
        this.angle += speed
        pop()
    }
}

class frame {
    constructor(x, y, dia) {
        this.x = x
        this.y = y
        this.dia = dia
    }
}